% zp=out.zp;
% f=out.f;

% row_indices=unique(randperm(size(NNs,1),size(NNs,1)/2));
% testDATA=NNs(row_indices, :);
% 
% non_selected_row_indices = setdiff(1:size(NNs, 1), row_indices);  
% trainDATA = NNs(non_selected_row_indices, :);

% XtestON=Xtest;
% time_long=size(XtestON,1);
% timePlus=0;
% testTime=0;
% for i=1:(time_long-1)
%     timePlus=timePlus+0.05;
%     testTime=[testTime;timePlus];
% end
% %timePlus=10/(time_long-1);
% %testTime=testTime';
% XtestON=[testTime,XtestON];
load("NN_ver1.mat");
y = net(Xtest');
time_long=size(Xtest,1);
Tout=[];
for i=1:time_long
    if(y(i)>19.15)
        AA=1;
    else
        AA=0;
    end
    Tout=[Tout;AA];
end
Tmatch=0;
for i=1:time_long
    if(Tout(i)==Ttest(i))
        Tmatch=Tmatch+1;
    end
end
AccNN=Tmatch/time_long;
%
%LMKF环节
q=10;
r=0.01;
AccNN_LMKF=0;
maxEpoch=500;
while(AccNN_LMKF==0)
    Q=q*eye(1);
    R=r*eye(1);
    %X_=0;
    P=1000*eye(1);
    for i=1:maxEpoch
        X_=0;
        x_group=[];
        H_group=[];
        for k=1:time_long
            H=[y(k),Xtest(k,:)];
            Xs_=X_;
            Ps=P+Q;
            K=Ps*H'/(H*Ps*H'+R);
            X_=Xs_+K*(ytest(k)-H*Xs_);
            P=(eye(1)-K*H)*Ps;
            x_group=[x_group;X_];
            H_group=[H_group;H];
        end
        z_group=[];
        err_z=[];
        for k=1:time_long
            z_=H_group(k,:).*x_group(k,:);
            z_group=[z_group;z_];
            err_z=[err_z;power(z_-ytest,2)];
        end
        MSEout=mse(ytest,z_group);
        if(MSEout<0.001)
            break
        end
    end
    %分类
    Tzk=[];
    for k=1:time_long
        if(z_group(k)>19.15)
            AA=1;
        else
            AA=0;
        end
        Tzk=[Tzk;AA];
    end
    Tmatch=0;
    for k=1:time_long
        if(Tzk(k)==Ttest(k))
            Tmatch=Tmatch+1;
        end
    end
    AccNN_LMKF=Tmatch/time_long;
end